ICCPath=/data8/home/dariaye/intel/composer_xe_2011_sp1.10.319
PRJPath=/data8/home/dariaye/walle
BINName=plsa_train
CC=icpc

#FLAGS= -g -lirc -DLIB_03 -openmp -msse2 -static -O2 -no-multibyte-chars 
FLAGS= -g -lirc -DLIB_03 -openmp -msse2 -O3
MKLLibs= -Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group 
#INCPath= -I${ICCPath}/mkl/include/ -I${PRJPath}/include -I${PRJPath}/include/base -I${PRJPath}/src/common -I${PRJPath}/src/loader -I${PRJPath}/src/core 
#LIBPath= -L${ICCPath}/lib/intel64 -L${ICCPATH}/mkl/lib/intel64 -L${PRJPath}/lib 
INCPath= -I${PRJPath}/include -I${PRJPath}/src/common -I${PRJPath}/src/loader -I${PRJPath}/src/core 
LIBPath= -L${PRJPath}/lib 

LIBS= -lmpichcxx -lmpich -lmpl -lopa ../lib/libgflags.a -lpthread -lrt
OBJS= plsa_train.o plsa_resolver.o util.o simple_loader.o critical_section.o

${BINName} : ${OBJS} Makefile
	${CC} ${FLAGS} ${INCPath} ${LIBPath} ${OBJS} ${MKLLibs} ${LIBS} -o ${BINName}

critical_section.o : common/critical_section.cc
	${CC} -c ${FLAGS} ${INCPath} common/critical_section.cc

simple_loader.o : loader/simple_loader.cc
	${CC} -c ${FLAGS} ${INCPath} loader/simple_loader.cc
	
util.o : common/util.cc
	${CC} -c ${FLAGS} ${INCPath} common/util.cc

plsa_resolver.o : core/plsa_resolver.cc
	${CC} -c ${FLAGS} ${INCPath} core/plsa_resolver.cc

plsa_train.o : main/plsa_train.cc
	${CC} -c ${FLAGS} ${INCPath} main/plsa_train.cc

clean:
	-rm ${OBJS} ${BINName}
